home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / ISSUE03 / CONSTRUC / TREDIT.OLD < prev    next >
Text File  |  1995-07-05  |  1KB  |  57 lines

  1. unit Tredit;
  2. interface
  3. uses
  4.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  5.   Forms, Dialogs, StdCtrls;
  6.  
  7. type
  8.   TRightEdit = class(TMemo)
  9.   private
  10.     { Private declarations }
  11.   protected
  12.     { Protected declarations }
  13.     property Align;
  14.     property Alignment;
  15.     property Lines;
  16.     property ScrollBars;
  17.     property WantReturns;
  18.     property WantTabs;
  19.     property WordWrap;
  20.   public
  21.     { Public declarations }
  22.     constructor Create(AOwner: TComponent); override;
  23.     procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
  24.   published
  25.     { Published declarations }
  26.     property CharCase;
  27.     property Text; { read GetText write SetText; }
  28.   end;
  29.  
  30. procedure Register;
  31.  
  32. implementation
  33.  
  34. constructor TRightEdit.Create(AOwner: TComponent);
  35. begin
  36.   inherited Create(AOwner);
  37.   Align := alNone;
  38.   Alignment := taRightJustify;
  39.   ScrollBars := ssNone;
  40.   WantReturns := False;
  41.   WantTabs := False;
  42.   WordWrap := False;
  43. end;
  44.  
  45. procedure TRightEdit.SetBounds(ALeft, ATop, AWidth, AHeight: Integer);
  46. begin
  47.   if AHeight > (2 * abs(Font.Height)) then AHeight := 2 * abs(Font.Height);
  48.   inherited SetBounds(ALeft, ATop, AWidth, AHeight);
  49. end;
  50.  
  51. procedure Register;
  52. begin
  53.   RegisterComponents('Dr.Bob', [TRightEdit]);
  54. end;
  55.  
  56. end.
  57.